<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
	<style type="text/css">
		#win{
			display: flex;
		}
		#target{
			border: #000000 2px solid;
			width: 100px;
			height: 100px;
		}
	</style>
</head>
<body>
	<div id="win">
		<div id="target"></div>
		<div id="form">
			<label>属性名：<input type="text" id="att"></label>
			<label>属性值：<input type="text" id="val"></label>
			<button type="button">执行</button>
		</div>
	</div>
	<script type="text/javascript">
		var btn = document.querySelector('button')
		var target = document.querySelector('#target')
		var att = document.querySelector('#att')
		var val = document.querySelector('#val')
		btn.onclick = function(){
			target.style[att.value] = val.value
		}
	</script>
</body>
</html>